{template 'admin','header'}
<form action="{$self_url}?action=search" onsubmit="return r_submit(this);">
<table width="100%" cellpadding="0">
<tr>
	
	<td width="120"><strong>状态:</strong><select name="passed"><option value="-1">全部</option><option value="0" {if $passed==='0'}selected{/if}>未审核</option><option value="1" {if $passed=='1'}selected{/if}>审核通过</option><option value="2" {if $passed=='2'}selected{/if}>审核未通过</option></select></td>
	<td width="180">&nbsp;&nbsp;<strong>关键字:</strong><input value="{if $kw!==false}{$kw}{/if}" type="text" name="kw"></td>
	<td><input type="submit" value="搜索"></td>	
</tr>
</table>
</form>

<form name='form1' action="{$self_url}?action=delall" method="POST" onsubmit="return r_submit(this);">
<table class="table_list">
 <caption>广告管理列表</caption>
 <tr>
	 <th width="80" class="align_c"><input type="checkbox" onclick="checkall(this,'ck')" id="chkall">全选/取消</th>
	 <th class="align_c">广告名称</th>
	 <th class="align_c">广告描述</th>
	 <th class="align_c" width="150">添加时间</th>
	 <th class="align_c" width="80">状态</th>
	 <th width="250" class="align_c">操作</th>
 </tr>
 {loop $list $a}
 <tr>
 <td class="align_c"><input type="checkbox" id="ck" value="{$a['adsid']}" name="ck[]"></td>
 <td>{$a['adsname']}</td>
 <td class="align_c">{text2html($a['description'],100)}</td>
 <td class="align_c">{date('Y-m-d H:i:s',$a['inputtime'])}</td>
 <td class="align_c">{if $a['passed']=='1'}审核通过{elseif $a['passed']=='2'}审核未通过{else}未审核{/if}</td>
 <td class="align_c">
 	{if check_perms('ads003')===true}<a href="{$self_url}?action=edit&aid={$a['adsid']}&forward={$forward}">修改</a> | {/if}
 	<a href="{$self_url}?action=code&aid={$a['adsid']}&forward={$forward}">调用代码</a>
 </td>
 </tr>
 {/loop}
</table>
<div class="button_box">
{if check_perms('ads002')===true}
<input type="button" value="添加广告" class="button_style" onclick="self.location='{$self_url}?action=add&forward={$forward}'">
{/if}
{if check_perms('ads004')===true}
<input type="button" value="批量删除" onclick="if(confirm('确定要删除选中的广告？')){change_opt('form1','{$self_url}?action=delall');}" class="button_style">
{/if}
{if check_perms('ads005')===true}
<input type="button" value="批量通过" onclick="if(confirm('确定要批量通过选中的广告？')){change_opt('form1','{$self_url}?action=passall&passed={ADS_PASS_PASSED}');}" class="button_style">
<input type="button" value="批量不通过" onclick="if(confirm('确定要批量不通过选中的广告？')){change_opt('form1','{$self_url}?action=passall&passed={ADS_PASS_NOPASSED}');}" class="button_style">
<input type="button" value="批量取消审核" onclick="if(confirm('确定要批量取消审核选中的广告？')){change_opt('form1','{$self_url}?action=passall&passed={ADS_PASS_NOAUDIT}');}" class="button_style">
{/if}
</div>
</form>

<div id="pages">
{$pages}
</div>
{template 'admin','footer'}